package com.ali.springcloud;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author ：ALi
 * @date ：Created in 2022/7/2 15:44
 * @description：控制类
 * @modified By：
 * @version: $
 */
@RestController
@Slf4j
public class OrderConsulController {
    //    public static final String PAYMENT_URL = "http://localhost:8001";
    public static final String INVOKE_URL = "http://consul-provider-payment";

    @Resource
    private RestTemplate restTemplate;



    @GetMapping("/consumer/payment/consul")
    public String PaymentInfo(){
        log.info("*******getPayment");
        return restTemplate.getForObject(INVOKE_URL+"/payment/consul",String.class);
    }
}